package com.distribution.system.manager.channel;

import com.alibaba.fastjson2.JSONObject;
import com.distribution.system.domain.bo.*;
import com.distribution.system.domain.dto.ChoosePhoneDTO;
import com.distribution.system.domain.dto.SendCodeDTO;
import com.distribution.system.domain.entity.*;
import com.distribution.system.domain.req.ReqResult;
import com.distribution.system.service.AddressChannelService;
import org.springframework.validation.annotation.Validated;

import java.util.List;
import java.util.Map;

/**
 * @author Liping Huo
 * @date 2023/5/23 1:01
 */
public interface Channel {
    AddressInfoBo getChannelAddressInfo(AddressNameBo addressNameBo, AddressChannelService addressChannelService);

    /**
     * @param choosePhoneDTO     选号信息
     * @param cmccDaProduct      卡信息
     * @param addressChannelService 地区信息
     * @Author: GodLu
     * @Date: 2024/5/1 21:47
     * @Description: 选号
     * @return: JSONObject
     */
    ReqResult choosePhone(ChoosePhoneDTO choosePhoneDTO, CmccDaProduct cmccDaProduct, AddressChannelService addressChannelService);
    String configChoosePhoneRequestParams(ChoosePhoneDTO choosePhoneDTO, CmccDaProduct cmccDaProduct, AddressInfoBo addressInfoBo);
    String sendChoosePhoneRequest(String requestJsonStr);
    ReqResult parseChoosePhoneResponseStr(JSONObject responseJsonObject);



    /**
    * @Author: GodLu
    * @Date: 2024/7/11 18:19
    * @Description: 下单
    * @param cmccDaOrder 订单信息
    * @param cmccDaProduct 商品信息
    * @param addressChannelService 地区服务
    * @return: ReqResult
    */
    ReqResult placeOrder(CmccDaOrder cmccDaOrder, CmccDaProduct cmccDaProduct, AddressChannelService addressChannelService);
    /**
     * @Author: GodLu
     * @Date: 2024/5/1 21:47
     * @Description: 配置请求参数
     * @param cmccDaOrder 订单信息
     * @param cmccDaProduct 卡信息
     * @param addressInfoBo 地区信息
     * @return: String 请求字符串
     */
    String configPlaceOrderRequestParams(CmccDaOrder cmccDaOrder, CmccDaProduct cmccDaProduct, AddressInfoBo addressInfoBo);
    /**
    * @Author: GodLu
    * @Date: 2024/7/13 16:28
    * @Description: 发送下单请求
    * @param requestJsonStr 请求字符串
    * @return: String 响应字符串
    */
    String sendPlaceOrderRequest(String requestJsonStr);
    /**
    * @Author: GodLu
    * @Date: 2024/7/13 16:29
    * @Description: 解析响应参数
    * @param responseJsonObject 响应参数
    * @return: ReqResult
    */
    ReqResult parsePlaceOrderResponseStr(JSONObject responseJsonObject);



    /**
    * @Author: GodLu
    * @Date: 2024/7/16 14:32
    * @Description: 发送验证码
    * @param unOrderProduct 下单产品
    * @param sendCodeDTO 验证码对象
    * @return: ReqResult
    */
    ReqResult sendSmsCode(CmccDaProduct unOrderProduct, SendCodeDTO sendCodeDTO);
    /**
    * @Author: GodLu
    * @Date: 2024/5/1 21:44
    * @Description: 发送号卡验证码
    * @param cmccDaProduct 卡信息
    * @param sendCodeDTO 发送验证码信息
    * @return: JSONObject
    */
    ReqResult sendCardSmsCode(CmccDaProduct cmccDaProduct, SendCodeDTO sendCodeDTO);



    /**
    * @Author: GodLu
    * @Date: 2024/5/1 21:44
    * @Description: 刷新单条订单状态
    * @param cmccDaOrder 订单编号
    * @return: JSONObject
    */
    RefreshOrderBO getRefreshOrderBO(@Validated CmccDaOrder cmccDaOrder);
    /**
    * @Author: GodLu
    * @Date: 2024/5/1 21:51
    * @Description: 批量更新订单状态
    * @param orderIdList 订单号集合
    * @return: JSONObject
    */
    Map<CmccDaOrder,RefreshOrderBO> getRefreshOrderBOMap(List<CmccDaOrder> orderIdList);




    /**
     * @Author: GodLu
     * @Date: 2024/5/1 21:48
     * @Description: 获取三方信息
     * @return: HashMap<Integer,CmccDaTripartiteInfoBO>
     */
    CmccDaUpChannelInfoBO getCmccDaChannelInfo();
    /**
    * @Author: GodLu
    * @Date: 2024/8/21 11:11
    * @Description: 刷新渠道方商品佣金
    * @param cmccDaUpChannelInfo 渠道方信息
    * @return: void
    */
    void refreshChannelCommission(CmccDaUpChannelInfo cmccDaUpChannelInfo);
}
